package basis.game.entities;

import basis.game.main.Renderable;
import java.awt.Shape;
import java.awt.geom.Rectangle2D;

public abstract class Entity implements Renderable{
    
    protected double x,y,w,h;
    protected boolean show=true;
    protected Rectangle2D.Double bounds;
    
    protected Entity(double x,double y,double w,double h){
        this.x=x;
        this.y=y;
        this.w=w;
        this.h=h;
        bounds=new Rectangle2D.Double(x,y,w,h);
    }
    
    @Override
    public void show(boolean s){
        show=s;
    }
    
    @Override
    public boolean isShown(){
        return show;
    }
    
    @Override
    public void setX(double x){
        this.x=x;
        bounds.x=x;
    }
    
    @Override
    public void setY(double y){
        this.y=y;
        bounds.y=y;
    }
    
    @Override
    public void move(double x,double y){
        this.x+=x;
        this.y+=y;
        bounds.x+=x;
        bounds.y+=y;
    }
    
    @Override
    public double getX(){
        return x;
    }
    
    @Override
    public double getY(){
        return y;
    }
    
    @Override
    public Shape getBounds(){
        return bounds;
    }

}